import lombok.Data;

import java.util.Vector;


public class MyTank extends Tank {

    Vector<Shot> shots = new Vector<>();


    public Vector<Shot> getShots() {
        return shots;
    }

    public void setShots(Vector<Shot> shots) {
        this.shots = shots;
    }



    public MyTank(int x, int y) {
        super(x, y);
    }

    public void shotEnemy() {
        Shot shot=null;
        switch (direct) {
            case 0:
                 shot = new Shot(x + 10, y, 0);
                shots.add(shot);
                break;
            case 1:
                shot = new Shot(x + 30, y + 10, 1);
                shots.add(shot);
                break;
            case 2:

                shot = new Shot(x + 10, y + 30, 2);
                shots.add(shot);
                break;
            case 3:

                shot = new Shot(x, y + 10, 3);
                shots.add(shot);
                break;
        }
        Thread thread = new Thread(shot);
        thread.start();

    }

    public void moveUp() {
        y = y - speed;
    }

    public void moveRight() {
        x = x + speed;
    }

    public void moveDown() {
        y = y + speed;
    }

    public void moveLeft() {
        x = x - speed;
    }
}
